package van.planifolia.template;

/**
 * Created by Intellij IDEA<br>
 *
 * @author Planifolia.Van
 * @version 1.0
 * @date 2022/11/10 16:40
 */
public class Square implements ShapeTemp {
    /**
     * 正方形的一个边长
     */
    int sideA;

    public Square(int sideA) {
        this.sideA = sideA;
    }

    @Override
    public double area() {
        System.out.println("该正方形的面积为" + sideA * sideA);
        return sideA * sideA;
    }

    @Override
    public double perimeter() {
        System.out.println("该正方形的周长为" + sideA * 4);
        return sideA * 4;
    }
}
